/*
 * ComplexMethod.h
 *
 *  Created on: Nov 1, 2017
 *      Author: david
 */

#ifndef COMPLEXMETHOD_H_
#define COMPLEXMETHOD_H_

typedef double (*CalcFunc)(double, double, double);

class ComplexMethod {
public:
	ComplexMethod():m_nCount(0){};
	virtual ~ComplexMethod(){};

	void Register( int id, CalcFunc pFunc )
	{
		m_nIDs[m_nCount] = id;
		m_fCalcFuncs[m_nCount++] = pFunc;
	};
	double DoCalc( int nIdx, double in_r, double in_i, double roi )
	{
		return m_fCalcFuncs[nIdx]( in_r, in_i, roi );
	};
	int GetCount( void )
	{
		return m_nCount;
	};
	int GetID( int nIdx )
	{
		return m_nIDs[nIdx];
	}
private:
	int m_nCount;
	int m_nIDs[100];
	CalcFunc m_fCalcFuncs[100];
};

#endif /* COMPLEXMETHOD_H_ */
